#include <iostream>
#include <fstream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <ctime>
#include <cstdlib>

using namespace std;

#define sz(x) ((int)((x).size()))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const double EPS = 1e-9;

struct Point {
	double x, y;

	Point(double x = 0.0, double y = 0.0) : x(x), y(y) {}
};

struct Ms {
	Point p1, p2;
	double a, b, c;
	bool isPoint, used;

	Ms(Point p1 = Point(), Point p2 = Point(), bool isPoint = false, bool used = false, double a = 0.0, double b = 1.0, double c = 0.0) :
		p1(p1), p2(p2), isPoint(isPoint), used(used), a(a), b(b), c(c) {}
};

bool isDigitOrFuck(char x) {
	return ('0' <= x && x <= '9') || (x == '-');
}

char str[150];
int o[150];
int no;
Ms st[150];
int nst;

Ms doIt(Ms a, Ms b) {
	if (a.isPoint && b.isPoint) {
		Ms res = Ms();
		res.a = a.p1.y - b.p1.y;
		res.b = b.p1.x - a.p1.x;
		res.c = -res.a * a.p1.x - res.b * a.p1.y;
		return res;
	}
	if (a.isPoint ^ b.isPoint) {
		if (a.isPoint) {
			double h = (b.a * a.p1.x + b.b * a.p1.y + b.c) / sqrt(b.a * b.a + b.b * b.b);
			h *= 2.0;
			double vx = h * b.a / sqrt(b.a * b.a + b.b * b.b);
			double vy = h * b.b / sqrt(b.a * b.a + b.b * b.b);
			Ms res = Ms();
			res.isPoint = true;
			res.p1.x = a.p1.x - vx;
			res.p1.y = a.p1.y - vy;
			return res;
		} else {
			swap(a, b);
			double h = (b.a * a.p1.x + b.b * a.p1.y + b.c) / sqrt(b.a * b.a + b.b * b.b);
			h *= 2.0;
			double vx = h * b.a / sqrt(b.a * b.a + b.b * b.b);
			double vy = h * b.b / sqrt(b.a * b.a + b.b * b.b);
			Ms res = Ms();
			res.isPoint = true;
			res.p1.x = a.p1.x - vx;
			res.p1.y = a.p1.y - vy;
			return res;
		}
	} else {
		double det = a.a * b.b - a.b * b.a;
		double detX = -(a.c * b.b - a.b * b.c);
		double detY = -(a.a * b.c - a.c * b.a);
		Ms res = Ms();
		res.isPoint = true;
		res.p1.x = detX / det;
		res.p1.y = detY / det;
		return res;
	}
}

void solve() {
	int n = strlen(str);
	nst = 0;
	no = 0;
	for (int i = 0; i < n; ) {
		if (str[i] == '(' && isDigitOrFuck(str[i + 1])) {
			i++;
			int x = 0;
			bool flag = false;
			if (str[i] == '-') {
				flag = true;
				i++;
			}
			while (i < n && isDigitOrFuck(str[i])) {
				x = x * 10 + str[i] - '0';
				i++;
			}
			if (flag)
				x = -x;
			Point p = Point();
			p.x = x;
			i++;
			int y = 0;
			flag = false;
			if (str[i] == '-') {
				flag = true;
				i++;
			}
			while (i < n && isDigitOrFuck(str[i])) {
				y = y * 10 + str[i] - '0';
				i++;
			}
			if (flag)
				y = -y;
			p.y = y;
			st[nst++] = Ms(p);
			st[nst - 1].isPoint = true;
			i++;
			while (no > 0 && o[no - 1] == 1) {
				st[nst - 2] = doIt(st[nst - 2], st[nst - 1]);
				nst--;
				no--;
			}
			continue;
		}
		if (str[i] == '(') {
			o[no++] = 0;
			i++;
			continue;
		}
		if (str[i] == '@') {
			o[no++] = 1;
			i++;
			continue;
		}
		if (str[i] == ')') {
			while (no > 0 && o[no - 1] != 0) {
				st[nst - 2] = doIt(st[nst - 2], st[nst - 1]);
				nst--;
				no--;
			}
			no--;
			while (no > 0 && o[no - 1] == 1) {
				st[nst - 2] = doIt(st[nst - 2], st[nst - 1]);
				nst--;
				no--;
			}
			i++;
			continue;
		}
	}
	while (no > 0) {
		st[nst - 2] = doIt(st[nst - 2], st[nst - 1]);
		nst--;
		no--;
	}
	printf("%.10lf %.10lf\n", st[0].p1.x, st[0].p1.y);
}

int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);

	while (scanf("%s", str) == 1 && str[0] != '#') {
		solve();
	}

	return 0;
}
